home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectSound / EffectsBuffers / frmWaves.frm < prev    next >
Text File  |  2001-10-08  |  6KB  |  220 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmWaves 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "WavesReverb Effects Update"
  6.    ClientHeight    =   2775
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   2775
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   2775
  14.    ScaleWidth      =   2775
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   1  'CenterOwner
  17.    Begin VB.CommandButton cmdOK 
  18.       Caption         =   "OK"
  19.       Height          =   315
  20.       Left            =   1800
  21.       TabIndex        =   8
  22.       Top             =   2340
  23.       Width           =   915
  24.    End
  25.    Begin MSComctlLib.Slider sldInGain 
  26.       Height          =   195
  27.       Left            =   60
  28.       TabIndex        =   0
  29.       Top             =   360
  30.       Width           =   2655
  31.       _ExtentX        =   4683
  32.       _ExtentY        =   344
  33.       _Version        =   393216
  34.       LargeChange     =   10
  35.       Min             =   -96
  36.       Max             =   0
  37.       TickFrequency   =   10
  38.    End
  39.    Begin MSComctlLib.Slider sldReverbMix 
  40.       Height          =   195
  41.       Left            =   60
  42.       TabIndex        =   2
  43.       Top             =   900
  44.       Width           =   2655
  45.       _ExtentX        =   4683
  46.       _ExtentY        =   344
  47.       _Version        =   393216
  48.       LargeChange     =   10
  49.       SmallChange     =   2
  50.       Min             =   -96
  51.       Max             =   0
  52.       TickFrequency   =   10
  53.    End
  54.    Begin MSComctlLib.Slider sldReverbTime 
  55.       Height          =   195
  56.       Left            =   60
  57.       TabIndex        =   4
  58.       Top             =   1440
  59.       Width           =   2655
  60.       _ExtentX        =   4683
  61.       _ExtentY        =   344
  62.       _Version        =   393216
  63.       LargeChange     =   100
  64.       SmallChange     =   10
  65.       Min             =   1
  66.       Max             =   3000
  67.       SelStart        =   1
  68.       TickFrequency   =   200
  69.       Value           =   1
  70.    End
  71.    Begin MSComctlLib.Slider sldHighFreq 
  72.       Height          =   195
  73.       Left            =   60
  74.       TabIndex        =   6
  75.       Top             =   1980
  76.       Width           =   2655
  77.       _ExtentX        =   4683
  78.       _ExtentY        =   344
  79.       _Version        =   393216
  80.       LargeChange     =   100
  81.       SmallChange     =   10
  82.       Min             =   1
  83.       Max             =   999
  84.       SelStart        =   1
  85.       TickFrequency   =   50
  86.       Value           =   1
  87.    End
  88.    Begin VB.Label lbl 
  89.       BackStyle       =   0  'Transparent
  90.       Caption         =   "High Freq RT Ratio"
  91.       Height          =   255
  92.       Index           =   4
  93.       Left            =   60
  94.       TabIndex        =   7
  95.       Top             =   1740
  96.       Width           =   1695
  97.    End
  98.    Begin VB.Label lbl 
  99.       BackStyle       =   0  'Transparent
  100.       Caption         =   "Reverb Time"
  101.       Height          =   255
  102.       Index           =   3
  103.       Left            =   60
  104.       TabIndex        =   5
  105.       Top             =   1200
  106.       Width           =   1035
  107.    End
  108.    Begin VB.Label lbl 
  109.       BackStyle       =   0  'Transparent
  110.       Caption         =   "Reverb Mix"
  111.       Height          =   255
  112.       Index           =   0
  113.       Left            =   60
  114.       TabIndex        =   3
  115.       Top             =   660
  116.       Width           =   1275
  117.    End
  118.    Begin VB.Label lbl 
  119.       BackStyle       =   0  'Transparent
  120.       Caption         =   "In Gain"
  121.       Height          =   255
  122.       Index           =   1
  123.       Left            =   60
  124.       TabIndex        =   1
  125.       Top             =   120
  126.       Width           =   735
  127.    End
  128. End
  129. Attribute VB_Name = "frmWaves"
  130. Attribute VB_GlobalNameSpace = False
  131. Attribute VB_Creatable = False
  132. Attribute VB_PredeclaredId = True
  133. Attribute VB_Exposed = False
  134. Option Explicit
  135. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  136. '
  137. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  138. '
  139. '  File:       frmWaves.frm
  140. '
  141. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  142. Private oBuffer As DirectSoundSecondaryBuffer8
  143. Private mlIndex As Long
  144.  
  145. Private oFX As DirectSoundFXWavesReverb8
  146.  
  147. Private Sub SaveAllSettings()
  148.     Dim fxNew As DSFXWAVESREVERB
  149.     
  150.     'Ok, save these new settings
  151.     'Set the new information up
  152.     With fxNew
  153.         .fInGain = CSng(sldInGain.Value)
  154.         .fReverbMix = CSng(sldReverbMix.Value)
  155.         .fReverbTime = CSng(sldReverbTime.Value)
  156.         .fHighFreqRTRatio = CSng(sldHighFreq.Value / 1000) 'Range is 0.001 - 0.999
  157.     End With
  158.     'Now update the effect
  159.     oFX.SetAllParameters fxNew
  160. End Sub
  161.  
  162. Private Sub cmdOK_Click()
  163.     SaveAllSettings
  164.     Unload Me
  165. End Sub
  166.  
  167. Private Sub Form_Load()
  168.     Dim fxCurrent As DSFXWAVESREVERB
  169.     
  170.     'Get the echo interface
  171.     Set oFX = oBuffer.GetObjectinPath(DSFX_STANDARD_WAVES_REVERB, mlIndex, IID_DirectSoundFXWavesReverb)
  172.     'Get the current settings from it
  173.     fxCurrent = oFX.GetAllParameters
  174.     'Now put them out there
  175.     With fxCurrent
  176.         sldInGain.Value = CLng(.fInGain)
  177.         sldReverbMix.Value = CLng(.fReverbMix)
  178.         sldReverbTime.Value = CLng(.fReverbTime)
  179.         sldHighFreq.Value = CLng(.fHighFreqRTRatio * 1000) 'Range is 0.001 - 0.999
  180.     End With
  181. End Sub
  182.  
  183. Public Sub SetBuffer(oBuf As DirectSoundSecondaryBuffer8, Index As Long)
  184.     'Store the buffer and index
  185.     Set oBuffer = oBuf
  186.     mlIndex = Index
  187. End Sub
  188.  
  189. Private Sub sldHighFreq_Change()
  190.     SaveAllSettings
  191. End Sub
  192.  
  193. Private Sub sldHighFreq_Scroll()
  194.     SaveAllSettings
  195. End Sub
  196.  
  197. Private Sub sldInGain_Change()
  198.     SaveAllSettings
  199. End Sub
  200.  
  201. Private Sub sldInGain_Scroll()
  202.     SaveAllSettings
  203. End Sub
  204.  
  205. Private Sub sldReverbMix_Change()
  206.     SaveAllSettings
  207. End Sub
  208.  
  209. Private Sub sldReverbMix_Scroll()
  210.     SaveAllSettings
  211. End Sub
  212.  
  213. Private Sub sldReverbTime_Change()
  214.     SaveAllSettings
  215. End Sub
  216.  
  217. Private Sub sldReverbTime_Scroll()
  218.     SaveAllSettings
  219. End Sub
  220.